/**
 * @Author：ming
 * @Date：2023/9/25 10:35 PM
 * @Filename：Lc28
 */

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author ming
 */
public class Lc28 {
    public int strStr(String haystack, String needle) {

        Pattern compile = Pattern.compile(needle);
        Matcher matcher = compile.matcher(haystack);
        if(matcher.find()){
            return matcher.start();
        }

        return -1;
    }
}
